@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  margin: 0;
  background-color: pink;
}

.search-box {
  width: 50px;
  height: 50px;
  background-color: #fff;
  border: 0;
  position: relative;
  display: flex;
  flex: row;
  justify-content: space-between;
  transition: .3s ease-in-out;
  -webkit-transition: .3s ease-in-out;
  -moz-transition: .3s ease-in-out;
  -ms-transition: .3s ease-in-out;
  -o-transition: .3s ease-in-out;
}

.search-box input {
  width: 0%;
  height: 50px;
  font-size: 20px;
  opacity: 0;
  border: 0;
  transition: .3s ease-in-out;
  -webkit-transition: .3s ease-in-out;
  -moz-transition: .3s ease-in-out;
  -ms-transition: .3s ease-in-out;
  -o-transition: .3s ease-in-out;
}

.search-box.active {
  width: 250px;
}

.search-box.active input {
  width: calc(100% - 60px);
  padding-left: 20px;
  opacity: 1;
}

.search-box input:focus {
  outline: 0;
}

.search-box button {
  display: inline-block;
  font-size: 25px;
  width: 50px;
  height: 50px;
  text-align: center;
  line-height: 50px;
  border: none;
  cursor: pointer;
  background-color: #fff;
}